import { ElSwitch } from 'element-plus';


const Switch = (config, params, emit, hasEvent) => {
    if(hasEvent) {
        return (
            <ElSwitch {...config.labelProps} v-model={params[config.props.prop]} onChange={() => emit('changeEvent', config)} />
        )
    }else {
        return (
            <ElSwitch {...config.labelProps} v-model={params[config.props.prop]} />
        )
    }

}

export default Switch
